package object.model;

public class JavaVariables {
	private String condiction;
	private String mysqlDataType;
	private String classFullName;
	private String classSimpName;
	private String varName;
	private boolean isPrimaryKey = false;
	public JavaVariables(String classFullName, String varName, String mysqlDataType, String condiction) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
		super();
		this.condiction = condiction;
		this.mysqlDataType = mysqlDataType;
		this.classFullName = classFullName;
		this.varName = varName;
		this.ini();
	}
		
	public String getClassFullName() {
		return classFullName;
	}

	public String getClassSimpName() {
		return classSimpName;
	}

	public String getVarName() {
		return varName;
	}

	public String getMysqlDataType() {
		return mysqlDataType;
	}
	
	public String getCondiction() {
		return condiction;
	}

	private void ini() throws InstantiationException, IllegalAccessException{
		try {
			String[] cn = this.classFullName.split("\\.");
			this.classSimpName = cn[cn.length-1];
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public boolean isPrimaryKey() {
		return isPrimaryKey;
	}

	public void setPrimaryKey(boolean isPrimaryKey) {
		this.isPrimaryKey = isPrimaryKey;
	}	
	
}
